import { AppDataSource } from "./data-source";
import { config } from "dotenv";
import { app } from "./server";

config();

const port = process.env.PORT || 5000;

AppDataSource.initialize()
  .then(() => {
    app.listen(port, () => {
      console.log(`server is running on port ${port}`);
    });
  })
  .catch((error) => console.error(error));
